#pragma once

#include <stdlib.h>

class Position
{
public:
    Position() {}
    Position(int _x, int _y) : x(_x), y(_y) {}

    int x = 0;
    int y = 0;
};

/**
 * @brief 生成一个随机坐标
 *
 * @param max_x x坐标上限
 * @param max_y y坐标上限
 * @return Position 拷贝赋值返回
 */
static inline Position random_position(int max_x, int max_y)
{
    Position p;
    p.x = (int)random() % max_x;
    p.y = (int)random() % max_y;

    return p;
}